//对应你要跳转的组件
import {createRouter, createWebHistory} from 'vue-router'
import Login from "@/view/login";
import index from "@/view/index"
import all from "@/view/store/all"
import description from '@/view/description'
import personCenter from '@/view/store/PersonalCenter'
import myMessage from '@/view/store/myMessage'
import address from '@/view/store/address'
const routerHistory = createWebHistory()
const router = createRouter({
    history: routerHistory,
    routes: [
        {
            path: '/Login',
            component:Login
        },
        {//默认进入页面
            path:'/',
            component:index,
            name:"index",
            redirect:()=>{
                let url = "/all"
                return url
            },
            children:[
                {path:"/all", component:all},
            ]
        },
        {
            path:'/description',
            component:description
        },
        {
            path:'/personCenter',
            component:personCenter,
            redirect:"/myMessage",
            children:[
                {path: '/myMessage', component: myMessage},
                {path: '/address', component: address}
            ]
        }
    ]
})
export default router

